<!DOCTYPE html>
<html>
  
  <head>
    
    <meta charset="utf-8">
    
    <title>Emascaro FrontEnd/BackEnd Test</title>
    
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/page.css">
    <link rel="stylesheet" href="css/table.css">
    <link rel="stylesheet" href="css/table_jui.css">
    <link rel="stylesheet" href="css/jquery-ui-1.7.2.custom.css">

    <script src="js/main.js"></script>

    <script src="js/jquery-1.4.4.min.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>
    <script src="js/jquery.jeditable.js"></script>
    <script src="js/jquery-ui.js"></script>
    <script src="js/jquery.validate.js"></script>
    <script src="js/jquery.dataTables.editable.js"></script>  
  
    <script language="JavaScript" type="text/javascript">
      $(document).ready(function () {
          $('#myDataTable').dataTable({
                            "oLanguage"   : {
                              "sEmptyTable"     : "Ningún dato disponible en la Tabla",
                              "sInfo"           : "Mostrando de _START_ a _END_ de _TOTAL_ Ofertas Especiales",
                              "sInfoEmpty"      : "Mostrando de 0 a 0 de 0 Ofertas Especiales",
                              "sInfoFiltered"		: "(filtrado desde _MAX_ total de Ofertas)",
                              "sLengthMenu"     : "Mostrar _MENU_ Ofertas por Página",
                              "sLoadingRecords"	: "Cargando...",
                              "sProcessing"     : "Procesando...",
                              "sSearch"         : "Buscar:",
                              "sZeroRecords"		: "Nada encontrado"
                              },  
                              "bJQueryUI": true,
                              fnDrawCallback: function() {
                                updateData();
                              }                            
                              }).makeEditable({
                                              sUpdateURL: "elem/updateOffer.php",
                                              sAddURL   : "elem/addOffer.php",
                                              sDeleteURL: "elem/deleteOffer.php",
                                              
                                            });
      });
    </script>
    
  </head>
  
  <body id="dt_example">
    
    <header class="header-diagonal">
      <div class="header-container">
        <figure class="figure-dz">
          <img id="img-dz" src="img/DiagonalZeroBarcelonaHotel.png"/>
        </figure>
        <nav class="nav-container" role="navigation">
          <ul>
            <li><a href="#Ofertas" id="dz-offers">Ofertas</a></li>
            <li><a href="#Ubucación" id="dz-place">Ubicación</a></li>
            <li><a href="#Habitaciones" id="dz-rooms">Habitaciones</a></li>
          </ul>
        </nav>
      </div>
    </header>
    
    <div class="main-container-back">
      
      <aside class="sidebar">
        <div id="menu-link">
          <div id="menu-resv-back" class="menu-active">
            <span>Ofertas</span>
          </div>
        </div>
        <div id="menu-content-back">
          <?php include_once 'elem/ofertas.php'; ?>
        </div>
      </aside>

      <article class="article-content-back">
        <section>
          <form class='newOffer' id="formAddNewRow" action="#" title="Adicionar Oferta">
            <label for="offer-desc">Oferta</label><br />
            <input type="text" name="offer-desc" id="offer-desc" class="required" value="" rel="0" />
            <br /><br />
            <label for="style-offer">Resaltado</label>
            <input type="checkbox" name="style-offer-checkbox" id="style-offer-checkbox" value="true" onclick="onclickStyler();"><br />
            <input type="text" name="style-offer" disabled="disabled" id="style-offer" class="required" value="Normal" rel="1" />
            <br /><br />
          </form>

          <div class='custom-offers' id="demo">
            <table id="myDataTable">

              <thead>
                <tr class="header-offers">
                  <th class="th1">Ofertas</th>
                  <th class="th2">Estilo</th>
                </tr>
              </thead>

              <tbody>
              <?php

                include_once 'etc/classes.php';

                $offers = new HandleXMLOffers(NULL);

                $offers->rewinOffers();
                $offers->nextOffer();

                while ($offers->getCurrentOffer()->getId() != "") {
              ?>
                <tr class="odd_gradeX" id="<?php echo $offers->getCurrentOffer()->getId(); ?>">
                  <td><?php echo $offers->getCurrentOffer()->getTitle(); ?></td>
                  <td><?php echo $offers->getCurrentOffer()->getHighlighted(); ?></td>
                </tr>
              <?php      
                  $offers->nextOffer();
                }
              ?>
              </tbody>

            </table>
            <div class="add_delete_toolbar toolbar-offer"></div>
            <div class="spacer"></div>  
          </div>
        </section>
      </article>
      
    </div>
    
  </body>
  
</html>
